﻿using NOSDC.Models;
using System.Web.Mvc;
using NOSDC.Services;

namespace NOSDC.Controllers
{
    public class ArticleController : Controller
    {
        private readonly IArticleService _articleService;

        public ArticleController()
            : this(new ArticleService()) { }

        public ArticleController(IArticleService articleService)
        {
            _articleService = articleService;
        }

        public ActionResult FullArticle(int? ArticleID, string articleName)
        {
            if (ArticleID == null) return View();

            var articleViewModel = new ArticleViewModel { Article = _articleService.GetArticleByID((int)ArticleID, true) };
            return View(articleViewModel);
        }
    }
}
